package com.example.caimogu.Goods2Json;

import android.util.Log;

import com.example.caimogu.bean.Goods;

import org.json.JSONObject;

/**
 * Created by Caimogu on 2016/4/20.
 */
public class Goods2JsonUtil {

    public JSONObject getGoodsJson(Goods goods){
        JSONObject jsonObject = new JSONObject();
        try {

            jsonObject.put("id", goods.getGid());
            jsonObject.put("name", goods.getName());
            jsonObject.put("bId", goods.getBid());
            jsonObject.put("price", goods.getPrice());
            jsonObject.put("selltime", goods.getSelltime());
            jsonObject.put("information", goods.getInformation());
            jsonObject.put("type", goods.getType());
            jsonObject.put("status", goods.getStatus());
            jsonObject.put("picPath",goods.getPicPath());


        }catch (Exception e){
            e.printStackTrace();
            Log.i("caimogu","Goods2JsonUtil....getGoodsJson() error...");
        }

        Log.i("caimogu",jsonObject+"");
        return jsonObject;
    }


}
